import os
import time

time_list = []
for num in range(100):
    start_time = time.time()
    res1 = os.popen("adb shell dumpsys window | findstr mCurrentFocus").read()
    end_time = time.time()
    res2 = os.popen("adb shell dumpsys window | findstr mCurrentFocus").read()
    if res1 != res2:
        res_time = round((end_time - start_time) * 1000)
        print(res2, res_time)
        time_list.append(res_time)
print(time_list)
